//
//  HomeViewController.m
//  LightControl
//
//  Created by CKF on 2025/8/1.
//

#import "HomeViewController.h"
#import "SearchDeviceViewController.h"
@interface HomeViewController ()

@end

@implementation HomeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"Smart Control";
    self.navigationItem.leftBarButtonItems = nil;
    [self addRightItem];
}

-(void)addRightItem{
    UIButton * rightBtn=[[UIButton alloc] initWithFrame:CGRectMake(0, 0, 44, 44)];
    [rightBtn setImage:[UIImage imageNamed:@"add_device"] forState:0];
    [rightBtn addTarget:self action:@selector(rightAct) forControlEvents:UIControlEventTouchUpInside];
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:rightBtn];
}

-(void)rightAct{
    SearchDeviceViewController *vc = [[SearchDeviceViewController alloc]init];
    vc.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:vc animated:YES];
}



/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
